<!--<?php
print <<<EOT
-->
<base target="_self">
<div class="m"></div>
<!--<div id="quote" style="background-color:#FFFFFF; position:absolute; right:5px; top:5px; width:400px; display:none" class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="head">
    <td><div style="float:right"><img src="images/admin/close.gif" onClick="hideQuote();" style="cursor:pointer"></div>图片引用情况</td>
  </tr>
  <tr>
    <td>
	<div id='quoteinfo' style="text-align:center; width:100%">
	</div></td>
  </tr>
</table>
</div>-->
<div id="loading" style="color:white;background-color:blue;position:absolute;padding:5px;display:none;
	top:250px; left:300px; z-index:90"><label id="DownloadInfo" style="display:block;color:#FFF;">正在加载图片，请稍候...</label></div>
<div id="preview" style="background-color:#FFFFFF; position:absolute; right:5px; top:5px; width:200px; display:none" class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="head">
    <td><div style="float:right"><img src="images/admin/close.gif" onClick="hidePreview();" style="cursor:pointer"></div>文件预览</td>
  </tr>
  <tr>
    <td>
	<div id='picture' style="text-align:center; width:100%; margin:auto;padding-top:7px; padding-bottom:7px;" class="lbox">
	</div></td>
  </tr>
</table>
</div>
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="tr4">
    <td style="text-align:center">
	<form action="$basename&type=$type" method="post">
	  <!--
	类型: &nbsp;&nbsp;
      <select name="displaytype" id="displaytype">
        <option value="0" selected="selected">所有{$very[contentName]}</option>
        $selectString
      </select> -->
      文件搜索：&nbsp;&nbsp;文件大于:&nbsp;&nbsp;
      <input name="minsize" type="text" class="trinput" id="minsize" size="5" maxlength="3" /> MB 
	  文件小于:&nbsp;&nbsp;
      <input name="maxsize" type="text" class="trinput" id="maxsize" size="5" maxlength="3" /> MB
      &nbsp;&nbsp;标题关键字搜索:&nbsp;&nbsp;
      <input name="keyword" type="text" class="trinput" id="keyword" size="10" />&nbsp;
      <input name="method" type="hidden" id="action" value="search" />
      &nbsp;
      <input type="submit" name="Submit2" value="检索相关资源" class="btn" />
	  </form>
	  </td>
  </tr>
</table>

</div>
<form action="$basename" method="post" name="file">
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="head">
    <td colspan="7">{$typename}文件管理</td>
    </tr>
  <tr class="tr2">
	<td width="5%">&nbsp;</td>
    <td>文件说明</td>
    <td>所属{$very[contentName]}</td>
    <td>存储点</td>
    <td>文件保存路径</td>
    <td width="80">文件大小</td>
    <td>上传时间</td>
<!--    <td>管理</td>-->
  </tr>
<!--
EOT;
foreach($files as $file){
print <<<EOT
-->
  <tr class="tr3">
	<td><input name="del[$file[tid]][]" type="checkbox" id="del[$file[rid]]" value="$file[rid]" /></td>
    <td><img src="$file[icon]" width="16" height="16" hspace="5" align="absmiddle" /><a href="$file[previewurl]">$file[filetitle] </a></td>
    <td><a href="$admin_file?adminjob=edit&action=edit&tid=$file[tid]">$file[title]</a></td>
    <td>$file[server]</td>
    <td>$file[filepath]</td>
    <td align="right">$file[filesize]</td>
    <td>$file[uploadtime]</td>
<!--    <td>&nbsp;</td> -->
  </tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<div class="pages">$pages</div>
<div class="sub">
  <input name="action" type="hidden" id="action" value="del" />
  <input type="button" name="Submit2" value="全选" class="btn" onClick="CheckAll(document.file);" />
  <input type="submit" name="Submit" value="删除" onClick="return confirm('您确定要删除选中的资源文件？');" class="btn" />
</div>
</form>
<script language="javascript" src="script/xhr.js"></script>
<script language="javascript">
var path = '$very[url]/$very[attachdir]';
var _img = null;

function showwmp(filepath)
{
	var vurl = filepath;
	var preview = document.getElementById('preview');
	preview.style.display='';
	preview.style.width = '450px';
	preview.style.height = '400px';
	var picture = document.getElementById("picture");
	picture.innerHTML = '<object width="420" height="360" classid="CLSID:CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"><param name="url" value="' + vurl + '" /><embed width="420" height="360" type="application/x-mplayer2" src="' + vurl + '"></embed></object>';
}

function showrm(filepath)
{
	var vurl = filepath;
	//alert(vurl);
	var preview = document.getElementById('preview');
	preview.style.display='';
	preview.style.width = '450px';
	preview.style.height = '400px';
	var picture = document.getElementById("picture");
	var string = '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="420" height="310">';
    string += '<param name="src" value="' + vurl + '" />' 
    string += '<param name="controls" value="Imagewindow" />'
    string += '<param name="console" value="clip1" />'
    string += '<param name="autostart" value="true" />'
    string += '<embed src="' + vurl + '" type="audio/x-pn-realaudio-plugin" autostart="true" console="clip1" controls="Imagewindow" width="420" height="310"></embed>'
	string += '</object><br />'
	string += '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="420" height="44">'
	string += '<param name="src" value="' + vurl + '" />'
    string += '<param name="controls" value="ControlPanel" />' 
    string += '<param name="console" value="clip1" />'
   	string += '<param name="autostart" value="true" />'
    string += '<embed src="' + vurl + '" type="audio/x-pn-realaudio-plugin" autostart="true" console="clip1" controls="ControlPanel" width="420" height="44"></embed>'
	string += '</object>'
	picture.innerHTML = string;
	//picture.innerHTML = '<object width="420" height="360" classid="CLSID:CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"><param name="url" value="' + vurl + '" /><embed width="420" height="360" type="application/x-mplayer2" src="' + vurl + '"></embed></object>';
}

function showpic(filepath){
	var preview = document.getElementById('preview');
	document.getElementById('picture').innerHTML="正在加载图片，请稍侯...";
	_img = new Image();
	_img.src = filepath;
	//alert(filepath);
	preview.style.display='';
	checkLoadFinished(1);			
}

function hidePreview(){
	document.getElementById('picture').innerHTML = '';
	document.getElementById('preview').style.display='none';
}

function checkLoadFinished(count) {
	if (count > 1000) { document.getElementById('picture').innerHTML = '发生错误，加载图片超时'; return; }
	var state = '';
	if (document.all) state = _img.readyState;
	else state = _img.complete ? 'complete' : '';
	if(state!='complete') { window.setTimeout("checkLoadFinished(" + (count + 1) + ")",50); return; }
	var MaxW = 400; var MaxH = 300;
    var dW=_img.width; var dH=_img.height;
    if(dW>MaxW || dH>MaxH) {  a=dW/MaxW; b=dH/MaxH;if(b>a){ a=b; } dW=dW/a; dH=dH/a; }
    if(dW > 0 && dH > 0) { _img.width=dW; _img.height=dH; }

	var picture = document.getElementById("picture");
	var childs = picture.childNodes; for (var i = 0; i < childs.length; ++i) picture.removeChild(childs[i]);
	_img.style.border="#E3E3E3 2px solid";
	picture.appendChild(_img);
	document.getElementById('loading').style.display="none";
	var pW = dW + 20;
	document.getElementById('preview').style.width= pW +"px";
}

function viewQuote(aid){
	var x = new XHR('showQuote');
	x.get("$basename&action=viewquote&aid="+aid);
	return false;
}

function showQuote(res){
	document.getElementById('quote').style.display = '';
	document.getElementById('quoteinfo').innerHTML = res;
}

function hideQuote(){
	document.getElementById('quote').style.display = 'none';
}
</script>
<!--
EOT;
?>-->